<template>
  <div class="von1">
    <h3>{{message}}</h3>
    <button @click="btnclick1">btnclick1()</button>
    <button @click="btnclick2(num,$event),btnclick3()">btnclick2</button>
    <h3 @click="btnclick3">h3动态绑定事件</h3>
    <button @click="changeMessage">changeMessage</button>
    <button @click="changeNum">changeNum</button>
  </div>
</template>

<script>
export default {
  name: "Von1",
  data() {
    return {
      num: 10,
      message: 100
    };
  },
  methods: {
    btnclick1(a) {
      console.log(a);
    },
    btnclick2(a, b) {
      console.log(a, b);
    },
    btnclick3() {
      console.log("aaaa");
    },
    changeMessage() {
      console.log(this);
      this.message = 300;
    },
   
  },
  components: {},
  computed: {},
  watch: {},
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {},
  updated() {}, //生命周期 - 更新之后
  activated() {} //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang='less' scoped>
//@import url(); 引入公共css类
</style>